home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Add-Ons
/
HyperCard
/
ScreenHeight XFCN 1.0.2
/
ScreenHeight.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-07
|
2KB
|
70 lines
/* ----------------------------------------------------------------------
ScreenHeight XFCN
version 1.0.2
Written by: Paul Celestin
Copyright © 1993-1996 Celestin Company, Inc.
This XFCN returns the height of the main screen in pixels.
No parameters required!
930925 - 1.0.0 - initial release
951215 - 1.0.1 - updated for CW7
960704 - 1.0.2 - updated for CW9
---------------------------------------------------------------------- */
#include <A4Stuff.h>
#include <HyperXCmd.h>
#define PARAMETER_NUMS 0
#define PARAMETER_TEXT "\pNo parameters required!"
/* ----------------------------------------------------------------------
prototypes
---------------------------------------------------------------------- */
void DoIt(XCmdPtr paramPtr);
char LookUp[256];
/* ----------------------------------------------------------------------
main
---------------------------------------------------------------------- */
pascal void main(XCmdPtr paramPtr)
{
Str255 copyright = "\pCopyright © 1993-1996 Celestin Company, Inc.";
long oldA4 = SetCurrentA4();
if (paramPtr->paramCount != PARAMETER_NUMS)
{
paramPtr->returnValue =
PasToZero(paramPtr,PARAMETER_TEXT);
}
else
{
DoIt( paramPtr );
}
SetA4(oldA4);
}
/* ----------------------------------------------------------------------
DoIt
---------------------------------------------------------------------- */
void DoIt(XCmdPtr paramPtr)
{
long height;
Str255 myString;
GDHandle curDev;
Rect bounds;
curDev = GetMainDevice();
bounds = (**curDev).gdRect;
height = bounds.bottom - bounds.top;
NumToStr(paramPtr,height,myString);
paramPtr->returnValue = PasToZero(paramPtr,myString);
}